/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "sej_trans")
@NamedQueries({
    @NamedQuery(name = "SejarahTransaksi.findAll", query = "SELECT s FROM SejarahTransaksi s")})
public class SejarahTransaksi implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_sej_trans")
    private Integer idSejTrans;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "id_pguna")
    private Pengguna pengguna;
    
    @ManyToOne
    @JoinColumn(name = "kod_urusan")
    private KodUrusan urusan;
    
    @ManyToOne
    @JoinColumn(name = "kod_status")
    private KodStatus status;
    
    @Column(name = "dari_akaun")
    private String dariAkaun;
    
    @Column(name = "kepada_akaun")
    private String kepadaAkaun;
    
    @Column(name = "amaun")
    private BigDecimal amaun;
    
    @Column(name = "nilai_dalaman1")
    private String nilaiDalaman1;
    
    @Basic(optional = false)
    @Column(name = "trh_masuk")
    @Temporal(TemporalType.TIMESTAMP)
    private Date trhMasuk;
    
    @Column(name = "id_sessi")
    private String idSessi;

    public SejarahTransaksi() {
    }

    public SejarahTransaksi(Integer idSejTrans) {
        this.idSejTrans = idSejTrans;
    }

    public Integer getIdSejTrans() {
        return idSejTrans;
    }

    public void setIdSejTrans(Integer idSejTrans) {
        this.idSejTrans = idSejTrans;
    }

    public Pengguna getPengguna() {
        return pengguna;
    }

    public void setPengguna(Pengguna pengguna) {
        this.pengguna = pengguna;
    }

    public KodUrusan getUrusan() {
        return urusan;
    }

    public void setUrusan(KodUrusan urusan) {
        this.urusan = urusan;
    }

    public KodStatus getStatus() {
        return status;
    }

    public void setStatus(KodStatus status) {
        this.status = status;
    }   

    public String getNilaiDalaman1() {
        return nilaiDalaman1;
    }

    public void setNilaiDalaman1(String nilaiDalaman1) {
        this.nilaiDalaman1 = nilaiDalaman1;
    }

    public Date getTrhMasuk() {
        return trhMasuk;
    }

    public void setTrhMasuk(Date trhMasuk) {
        this.trhMasuk = trhMasuk;
    }

    public String getDariAkaun() {
        return dariAkaun;
    }

    public void setDariAkaun(String dariAkaun) {
        this.dariAkaun = dariAkaun;
    }

    public String getKepadaAkaun() {
        return kepadaAkaun;
    }

    public void setKepadaAkaun(String kepadaAkaun) {
        this.kepadaAkaun = kepadaAkaun;
    }

    public BigDecimal getAmaun() {
        return amaun;
    }

    public void setAmaun(BigDecimal amaun) {
        this.amaun = amaun;
    }

    public String getIdSessi() {
        return idSessi;
    }

    public void setIdSessi(String idSessi) {
        this.idSessi = idSessi;
    }
    
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSejTrans != null ? idSejTrans.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SejarahTransaksi)) {
            return false;
        }
        SejarahTransaksi other = (SejarahTransaksi) object;
        if ((this.idSejTrans == null && other.idSejTrans != null) || (this.idSejTrans != null && !this.idSejTrans.equals(other.idSejTrans))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "th.model.SejarahTransaksi[ idSejTrans=" + idSejTrans + " ]";
    }
    
}
